Repository navigation
Animate the indeterminate progress bar with Core Animation - #1187
Merged
Merged
Conversation
The SwiftUI phase animator updated the view graph on the main thread for each display frame while an agent worked. Core Animation moves the strip in the render server, and a 30 fps limit reduces the WindowServer cost.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A progress report without a value (OSC 9;4;3) shows a sliding strip at the top of the pane. A SwiftUI
phaseAnimatormoved it, so the app updated the view graph on the main thread for each display frame while the report was active. Found during the investigation of #1186. This change does not address theInvalid windowmessages in that issue.Change
GhosttyIndeterminateProgressBar). The width, speed, easing, and colors are the same.Measurements
Debug builds, one working pane, all indicators on, CPU over 20 s, two runs each, window in front.
The "before" rows and the "before" video are from an experimental build that could select the original
phaseAnimator. The "after" row for 27.0.1 is from the same build with the same Core Animation settings. The "after" row for 27.2 is from this branch.The rest of the WindowServer cost is mainly from the two system spinners (tab and sidebar row): about 25–27% on 27.2 without the bar.
Verification
make check,make build-app, andmake testpass. New tests cover travel, resize, Reduce Motion, and empty width.Before:
before.mp4
After:
after.mp4
States (sliding, 40%, error, paused, sliding again):